﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Globalization;
using System.Threading;

namespace MovieWebApp.Pages
{
    public partial class Shopping_Cart : System.Web.UI.Page
    {
        public DataTable Cart;
        public DataView CartView;
        public DataSet productsDS = new DataSet();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["ShoppingCart"] == null)
            {
                Cart = new DataTable();
                Cart.Columns.Add(new DataColumn("code", typeof(string)));
                Cart.Columns.Add(new DataColumn("MovieTitle", typeof(string)));
                Cart.Columns.Add(new DataColumn("description", typeof(string)));
                Cart.Columns.Add(new DataColumn("productionStudio", typeof(string)));
                Cart.Columns.Add(new DataColumn("price", typeof(string)));
                Cart.Columns.Add(new DataColumn("quantity", typeof(string)));
            }
            else
                Cart = (DataTable)Session["ShoppingCart"];

        }

        protected override void InitializeCulture()
        {
            if ((string)Session["Language"] != null)
            {
                string selectedLanguage = (string)Session["Language"];
                UICulture = selectedLanguage;
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(selectedLanguage);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedLanguage);
            }
            base.InitializeCulture();
        }
    }
}
